package com.heartrate;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;

import com.heartrate.module.chart.HeartChart;
import com.heartrate.module.heart.HeartActivity;
import com.heartrate.module.heart.HeartLine;
import com.heartrate.module.heart.HeartRateAnimation;
import com.heartrate.module.main.MvpTestActivity;

/**
 * Created by admin on 2017/8/9.
 */

public class MainActivity extends ListActivity {

    private String[] items = new String[]{"Mvp模式网络数据测试","手机测心率","心率折线图","单词测心率动画","心率曲线"};
    private Class[] classes = new Class[]{MvpTestActivity.class, HeartActivity.class, HeartLine.class, HeartRateAnimation.class, HeartChart.class};

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,items));
        getListView().setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                startActivity(new Intent(MainActivity.this,classes[i]));
            }
        });

    }
}
